﻿<!doctype html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width,initial-scale=1.0,maximum-scale=1.0,minimum-scale=1.0,user-scalable=no">
    <title>添加发包任务</title>
    <link href="Style/Common.css" rel="stylesheet">
    <link href="Style/Employ.css" rel="stylesheet">
    <script src="Js/jquery-1.9.0.min.js" type="text/javascript"></script>
    <script src="Js/jquery.cookie.js" type="text/javascript"></script>
    <script src="Js/jquery.form.js" type="text/javascript"></script>
    <script src="http://api.map.baidu.com/api?v=1.4" type="text/javascript"></script>
    <script src="Js/Banner.js" type="text/javascript"></script>
    <link href="mobiscroll-break/css/mobiscroll.custom-2.16.1.min.css" rel="stylesheet"
        type="text/css" />
    <script src="mobiscroll-break/js/mobiscroll.custom-2.16.1.min.js" type="text/javascript"></script>
    <style>
        .priceSelected
        {
            background: #339efe;
            color: #fff;
        }
    </style>
</head>
<body id="All">
    <div class="Header">
        <p id='titleP'>
            添加发包任务</p>
        <span onclick="history.go(-1)">
            <img src="Images/Return.png"></span> <a href="javascript:addGoods(0,'QB')">保存</a>
    </div>
    <!--Header end-->
    <ul class="EnterId">
        <li><span>开工日期</span>
            <input style="color: #333;" type="text" id="jobStartTime" class="Sizing" placeholder="开工日期" />
            <img src="Images/GrayRight.png">
        </li>
        <li><span>工期(天)</span>
            <input class="Sizing" type="number" style="color: #333;" id="jobDay" placeholder="天数"
                value="1">
            <img src="Images/GrayRight.png">
        </li>
        <li><span>工&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;种</span>
            <input class="Sizing" id="categoryName" onfocus="All.style.position = 'fixed';PopBg.style.display = 'block';"
                placeholder="请选择工种" readonly>
            <input type="hidden" id="categoryId" />
            <img src="Images/GrayRight.png">
        </li>
        <li><span>面积(m<sup>2</sup>)</span>
            <input class="Sizing" type="number" style="color: #333;" id="jobArea" placeholder="面积">
            <img src="Images/GrayRight.png">
        </li>
        <li><span>任务标题</span>
            <input placeholder="请输入任务标题" class="Sizing" onfocus="this.value = '';this.style.color = '#333'"
                id="goodsName">
            <img src="Images/GrayRight.png">
        </li>
    </ul>
    <p class="UpLoadTit">
        任务描述</p>
    <textarea class="TaskDes" onfocus="this.style.color = '#333'" id="goodsDesc" placeholder="请输入内容"></textarea>
    <ul class="EnterId">
        <li><span>价格(元)</span> <b class="Sizing" id="salePrice"><a href="javascript:showPrice(0);"
            class="Price Sizing" id="priceZero">不限价</a><a href="javascript:showPrice(1);$('#priceNumber').focus();"
                class="Price Sizing" id="priceHigh">最高价</a><input value="" id="priceNumber" type="number"
                    style="height: 2.5em; width: 30%; padding: 0 .5em; border: 1px solid #339efe;
                    position: relative; float: left; margin: 0 0.8em 0 0; color: #339efe; border-radius: 4px;
                    display: none;">
        </b></li>
        <li><span>工程需求</span> <b class="Sizing" id="jobNeeds"><a id="jobNeeds1" href="javascript:opNeeds('jobNeeds1','包工')">
            包工<i class="Selected"></i></a> <a id="jobNeeds2" href="javascript:opNeeds('jobNeeds2','包工包料')">
                包工包料</a> <a id="jobNeeds3" href="javascript:opNeeds('jobNeeds3','包工及工具')">包工及工具</a>
        </b></li>
        <li><span>施工地址</span>
            <input placeholder="默认LBS定位地址，可修改" class="Sizing" onfocus="this.style.color = '#333'"
                id="jobAddress">
        </li>
        <li><span>上传图片</span>
            <input class="Sizing" style="visibility: hidden" /></li>
    </ul>
    <div class="TaskImgBox" id="divImgs">
        <!--<span><img src="Images/TaskImg1.jpg"><a href="#" class="Delete"></a></span>-->
        <span>
            <img src="Images/add.png" style="">
            <a href="javascript:;" class="Delete" style="visibility: hidden"></a>
            <form id="taskForm" method="post">
            <input type="file" class="Sizing" style="color: #333; opacity: 0; float: right; width: 100%;
                height: 100%" id="upFile" name="upFile" onchange="fileAdd()">
            </form>
        </span>
    </div>
    <!--TaskImgBox end-->
    <input type="button" class="SubmitBtn" value="确认发布" onclick="addGoods(1,'QB')">
    <div class="MenuBar" id="menuDiv">
    </div>
    <!--MenuBar end-->
    <div id="PopBg">
        <div class="JobClass">
            <ul id="cateUl">
            </ul>
            <a href="javascrip:void;" class="Close" onclick="All.style.position = 'relative';PopBg.style.display = 'none';">
                <img src="Images/X.png"></a>
        </div>
    </div>
    <!--PopBg end-->
</body>
</html>
<script src="Js/common.js" type="text/javascript"></script>
<script src="Js/Goods.js" type="text/javascript"></script>
<script>
    getAuthStep();
    getCategory();
    getGoods();
    if (jobNeeds == '') {
        jobNeeds = '包工';
    }

    $(function () {
        $('#jobStartTime').mobiscroll().calendar({
            theme: 'android-holo-light',
            lang: 'zh',
            mode: 'scroller',
            display: 'bubble',
            controls: ['calendar', 'date', 'time']
        });
    });

    // LBS兼容性 begin
    if (navigator.userAgent.indexOf("Html5Plus")<0){
        //TODO 使用浏览器自带的HTML5 的方式获取地理位置
        if (navigator.geolocation) {
                navigator.geolocation.getCurrentPosition(function (position) {
                        showPosition(position);
                    });
        }
    } else {
        document.addEventListener('plusready', function(){
            plus.geolocation.getCurrentPosition(function (p){
                //alert( "Geolocation\nLatitude:" + p.coords.latitude + "\nLongitude:" + p.coords.longitude + "\nAltitude:" + p.coords.altitude );
                showPosition(p);
            }, function(){
                alert( "Geolocation error: " + e.message );
            });
        }, false);
    }
    // LBS兼容性 end
</script>
